home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / HardwareContext-umax.s,v < prev    next >
Text File  |  1989-06-21  |  2KB  |  129 lines

  1. head     3.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.3; strict;
  6. comment  @# @;
  7.  
  8.  
  9. 3.3
  10. date     89.06.21.10.14.29;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.2;
  13.  
  14. 3.2
  15. date     89.02.20.15.34.54;  author grunwald;  state Exp;
  16. branches ;
  17. next     3.1;
  18.  
  19. 3.1
  20. date     88.12.20.13.50.33;  author grunwald;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     88.10.30.13.03.42;  author grunwald;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @@
  32.  
  33.  
  34. 3.3
  35. log
  36. @*** empty log message ***
  37. @
  38. text
  39. @# Function:
  40.     .text
  41. define(THREAD_FP,   0($1))
  42. define(THREAD_SP,  4($1))
  43. define(THREAD_BASE,8($1))
  44. define(THREAD_END, 12($1))
  45. define(THREAD_MAX, 16($1))
  46.  
  47. define(CONTEXT_FROM, 8(fp))        # pointer to object instance
  48. define(CONTEXT_TO, 12(fp))        # first arg
  49.  
  50. # Thread::exchj() -- Thread exchange jump (co--routine call)
  51. #
  52. # Transfer control from the active process to a new process.
  53. #
  54.     .text
  55. #ifdef    __Cplusplus__
  56.     .globl    __HardwareContext_magicSwitchTo
  57. __HardwareContext_magicSwitchTo:
  58. #endif
  59. #ifdef    __GNUG__
  60.     .globl _magicSwitchTo_PSHardwareContext_PSHardwareContext
  61.  _magicSwitchTo_PSHardwareContext_PSHardwareContext:
  62. #endif
  63.     enter    [r1,r2,r3,r4,r5,r6,r7],$0
  64.     movl    f0,tos
  65.     movl    f2,tos
  66.     movl    f4,tos
  67.     movl    f6,tos
  68.  
  69.     movd    CONTEXT_FROM,r0
  70.     sprd    fp,THREAD_FP(r0)    # save the current FP
  71.     sprd    sp,THREAD_SP(r0)
  72.  
  73.     movd    CONTEXT_TO,r0        # r0 = address of dst Thread object
  74.     lprd    fp,THREAD_FP(r0)    # load FP of destination Thread
  75.     lprd    sp,THREAD_SP(r0)    # load Sp of destination
  76.  
  77.     movl    tos,f6
  78.     movl    tos,f4
  79.     movl    tos,f2
  80.     movl    tos,f0
  81.     exit    [r1,r2,r3,r4,r5,r6,r7]
  82.     ret    $0
  83.     
  84.     .text
  85. #ifdef    __Cplusplus__
  86.     .globl __HardwareContext_getSp
  87. __HardwareContext_getSp:
  88. #endif
  89. #ifdef    __GNUG__
  90.     .globl _getSp_PSHardwareContext
  91. _getSp_PSHardwareContext:
  92. #endif
  93.     sprd    sp,r0            # load the FP into the return reg
  94.     ret    $0
  95. @
  96.  
  97.  
  98. 3.2
  99. log
  100. @Start using Gnu library heaps for schedulers
  101. @
  102. text
  103. @d21 4
  104. d50 4
  105. @
  106.  
  107.  
  108. 3.1
  109. log
  110. @Steay version
  111. @
  112. text
  113. @@
  114.  
  115.  
  116. 1.1
  117. log
  118. @Initial revision
  119. @
  120. text
  121. @d3 5
  122. a7 5
  123. define(THREAD_FP,   0($*))
  124. define(THREAD_SP,  4($*))
  125. define(THREAD_BASE,8($*))
  126. define(THREAD_END, 12($*))
  127. define(THREAD_MAX, 16($*))
  128. @
  129.